home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / mail / pp / pp-6.0 / Tools / tables / pp-rfc987 / awk.or2rfc next >
Encoding:
Text File  |  1991-12-18  |  1.2 KB  |  63 lines

  1. #!/bin/sh
  2. #
  3. #
  4. #       awk.or2rfc - is an awk program that reformats the
  5. #       the PP tables into the RFC-987 International ones.
  6. #
  7. #
  8. #       syntax :    awk.or2rfc  {first | multi}  input-table
  9. #
  10. ######################################################################
  11.  
  12. AWK=/usr/bin/awk
  13.  
  14. FILEIN=$1
  15. FILETEMP=or2rfc.temp
  16.  
  17. if [ -z "$FILEIN" ]
  18. then
  19.         echo " "
  20.         echo "Usage:   awk.or2rfc  input-table"
  21.         echo " "
  22.         exit 1
  23. fi
  24.  
  25. grep "^C" $FILEIN >$FILETEMP
  26. grep "^ADMD" $FILEIN >>$FILETEMP
  27. grep "^PRMD" $FILEIN >>$FILETEMP
  28. grep "^O" $FILEIN | sort -u >>$FILETEMP 
  29.  
  30.  
  31.  
  32. #---------------------- Start of the awk routines  --------------------------#
  33.  
  34.  
  35.  
  36. $AWK <$FILETEMP '
  37. BEGIN   {
  38.  
  39.         print("#")
  40.         print("#=============================================================================")
  41.         print("#======================================================= United Kingdom ======")
  42.         print("#        Last update: 90.02.01")
  43.         print("#        Responsible: John Seymour <John.Seymour@ean-relay.ac.uk>")
  44.         print("#")
  45.         print("#    Beware of the quoted dots in this table!")
  46.         print("#")
  47.         FS =":"
  48.         }
  49.  
  50. /^#.*/  {
  51.                 continue
  52.         }
  53.         {
  54.         printf("%s#%s#\n", $1, $2)
  55.         continue
  56.         }
  57.  
  58. END     {}
  59.  
  60. '
  61.  
  62. rm $FILETEMP
  63.